package com.algorithm.thePrimaryAlgorithm;


import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;

class ListNode21 {
    int val;
    ListNode21 next;

    ListNode21(int x) {
        val = x;
    }
}

/**
 *  经典思路 把我变成你  然后删了你
 */
@Slf4j
public class LinkSulotionLC21 {
    public void deleteNode(ListNode21 node) {
        node.val = node.next.val;
        node.next = node.next.next;
    }

    @Test
    public void test(){
        ListNode21 l1 = new ListNode21(12);
        ListNode21 l2 = new ListNode21(2);
        ListNode21 l3 = new ListNode21(1);
        l1.next = l2;
        l2.next = l3;
        deleteNode(l2);
        log.info("best time");

    }

}
